import Vue from "vue";
import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import VueRouter from "vue-router";
import store from "./store";
import "@/assets/css/normalize.css";
import echarts from "echarts";
import jquery from "jquery";
import axios from "axios";
import ajax from "ajax";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "./utils/element";
import "@/permission";
import "@/common/common.js";
import  qs from 'qs'

Vue.prototype.$axios = axios;
Vue.prototype.$jquery = jquery;
Vue.prototype.$ajax = ajax;
Vue.prototype.$store = store;
Vue.prototype.$qs = qs
// 将编程式导航调用 push() 时可能报错的异常静默处理
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location, onSuccess, onFail) {
  if (onSuccess || onFail) {
    return originalPush.call(this, location, onSuccess, onFail);
  }
  return originalPush.call(this, location).catch(() => { });
};

Vue.prototype.$store = store;
Vue.config.productionTip = false;
Vue.use(ElementUI);
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
